package service;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import dao.LoginDao;
import pojo.User;

@Service("loginService")
@Mapper
public class LoginService {
	
	@Autowired
	private LoginDao loginDao;
	
	public User selectUser(@Param("userid")int userid,@Param("password")String password) {
		return loginDao.selectUser(userid,password);
	}
	public List<User>selectAll() {
		return loginDao.selectAll();
	}
	public List<User> selectUserByName(@Param("username")String username) {
		return loginDao.selectUserByName(username);
	}
	public int insertUser(User user) {
		return loginDao.insertUser(user);
	}
	public int nextPrimaryKey() {
		return loginDao.nextPrimaryKey();
	}
	public int deleteUser(@Param("userid")int userid) {
		return loginDao.deleteUser(userid);
	}
	public User selectUserById(int userid) {
		return loginDao.selectUserById(userid);
	}
}
